<template>
	<view>
		<!-- 地址 -->
		<navigator url="/pages/address/address?source=1" class="address-section">
			<view class="order-content" v-if="addressData!=''">
				<text class="yticon icon-shouhuodizhi"></text>
				<view class="cen">
					<view class="top">
						<text class="name">{{addressData.FConsignee}}</text>
						<text class="mobile">{{addressData.FPhone}}</text>
					</view>
					<text class="address">{{addressData.FPrCityArea}} {{addressData.FAddress}}</text>
				</view>
				<text class="yticon icon-you"></text>
			</view>
			<view v-else>
				<text class="name">还没有设置地址</text>
			</view>

			<image class="a-bg"
				src="">
			</image>
		</navigator>

		<view class="goods-section">
			<view class="g-header b-b">
				<image class="logo" src="http://duoduo.qibukj.cn/./Upload/Images/20190321/201903211727515.png"></image>
				<!-- <text class="name">西城小店铺</text> -->
			</view>
			<!-- 商品列表 -->
			<view class="g-item" v-for="(item,index) in goodsData" :key="index">
				<image :src="item.img||item.FProImage[0]"></image>
				<view class="right">
					<text class="title clamp">{{item.title||item.FName}}</text>
					<!-- 类型/选择的商品类型 -->
					<text class="spec"></text>
					<view class="price-box">
						<text class="price" v-if="typeID==0&&orderid==''">
							￥{{item.FMallPrice}}+{{item.FMallPoint}}积分
						<!-- 	￥{{TypeID==1?item.vipprice:item.mallprice}}
							<text v-if="TypeID==1">(会员价)</text> -->
						</text>
						<!-- <text class="price" v-else-if="typeID==1&&orderid==''">
							￥{{
								(TypeID==1?item.FVipPrice:item.FMallPrice)||item.price
							}}
							<text v-if="TypeID==1">(会员价)</text>
						</text> -->
						<text class="price" v-else-if="typeID==1&&orderid==''">
							￥{{item.FMallPrice}}+{{item.FMallPoint}}积分
							<!-- ￥{{TypeID==1?item.FVipPrice:item.FMallPrice}}
							<text v-if="TypeID==1">(会员价)</text> -->
						</text>
						<text class="price" v-else-if="repeat==1&&orderid!=''">￥{{item.price}}</text>
						<!-- 订单中过来的支付,没有区分电商价与会员价a -->
						<text class="number">x {{item.qty||1}}</text>
					</view>
				</view>
			</view>
			<view class="g-item" v-if="goodsData== ''">暂无商品</view>
		</view>

		<!-- 优惠明细 -->
		<view class="yt-list">
			<view class="yt-list-cell b-b" @click="toggleMask('show')">
				<view class="cell-icon">
					券
				</view>
				<text class="cell-tit clamp">优惠券</text>
				<text class="cell-tip active" v-if="chooseCoupons!=''">
					{{chooseCoupons}}
				</text>
				<text class="cell-tip active" v-else>
					选择优惠券
				</text>
				<text class="cell-more wanjia wanjia-gengduo-d"></text>
			</view>
			<view class="yt-list-cell b-b">
				<view class="cell-icon hb">
					减
				</view>
				<text class="cell-tit clamp">商家促销</text>
				<text class="cell-tip disabled">暂无可用优惠</text>
			</view>
		</view>
		<!-- 金额明细 -->
		<view class="yt-list">
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">商品金额</text>
				<text class="cell-tip">￥{{amount}}</text>
			</view>
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">优惠卡金额</text>
				<text class="cell-tip red">-￥{{discounts}}</text>
			</view>
			<view class="yt-list-cell b-b" :class="TypeID==0?'':'none'">
				<text class="cell-tit clamp">会员优惠</text>
				<text class="cell-tip">{{MDiscount||1}}</text>
			</view>
<!-- 			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">送达方式</text>
				<view class="cell-tip">
					<radio-group >
						<view class="" style="float: left;">
							<text>快递</text>
							<radio value="0"></radio>
						</view>
						<view class="" style="float: left;">
							<text>自取</text>
							<radio value="1"></radio>
						</view>
					</radio-group>
				</view>
			</view> -->
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">送货方式</text>
				<view class="cell-tip">
					<radio-group @change="deliveryChoosc">
						<!-- <view v-for="item in delivery" :key="index" class="" style="float: left;" >
							<text>{{item.text}}</text>
							<radio value="{{item.id}}"></radio>
						</view> -->
						 <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in delivery" :key="item.value">
							<view style="display: inline-block;">{{item.text}}</view>
							<view style="display: inline-block;">
								<radio :value="item.id" :checked="index === current" />
							</view>
						</label>
					</radio-group>
				</view>
			</view>
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">支付方式</text>
				<view class="cell-tip">
					<radio-group @change="payChoose">
						<view class="" style="float: left;">
							<text>微信支付</text>
							<radio value="1"></radio>
						</view>
						<view class="" style="float: left;">
							<text>会员卡支付</text>
							<radio value="2"></radio>
						</view>
					</radio-group>
				</view>
			</view>
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">运费</text>
				<text class="cell-tip" v-if="expMoney==0">免运费</text>
				<text class="cell-tip" v-else>￥{{expMoney}}</text>
			</view>
			<view class="yt-list-cell desc-cell">
				<text class="cell-tit clamp">备注</text>
				<input class="desc" type="text" v-model="desc" placeholder="请填写备注信息" placeholder-class="placeholder" />
			</view>
		</view>

		<!-- 底部 -->
		<view class="footer">
			<view class="price-content">
				<text>实付款</text>
				<text class="price-tip">￥</text>
				<text class="price">{{total}}</text>
			</view>
			<text class="submit" @click="submit">{{orderid==''?'提交订单':'马上支付'}}</text>
		</view>

		<!-- 优惠券面板 -->
		<view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
			<view class="mask-content">
				<!-- 优惠券页面，仿mt -->
				<view v-if="couponList!=''">
					<view class="coupon-item" v-for="(item,index) in Coupon" :key="index"
						@click.stop.prevent="stopPrevent(item)">
						<view class="con" bind-FItemID="item.FItemID">
							<view class="left">
								<text class="title">{{item.FName}}</text>
								<text class="time">有效期至{{item.endtiem}}</text>
							</view>
							<view class="right">
								<text class="price">{{item.FValue}}</text>
								<text>满{{item.FMinValue}}可用</text>
							</view>

							<view class="circle l"></view>
							<view class="circle r"></view>
						</view>
						<text class="tips">{{item.FDescription||'限新用户使用'}}</text>
					</view>
				</view>
				<view v-else>
					<text>暂无优惠劵</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';
	let Discount = '', //优惠价
		Pay = [], //支付方式
		Newid = '';
	export default {
		data() {
			return {
				maskState: 0, //优惠券面板显示状态
				desc: '', //备注
				payType: '', //1微信 2会员卡余额
				deliveryType:'',//自提还是送货
				couponList: [{
						title: '新用户专享优惠券',
						price: 5,
					},
					{
						title: '庆五一发一波优惠券',
						price: 10,
					},
					{
						title: '优惠券优惠券优惠券优惠券',
						price: 15,
					}
				],
				addressData: {
					name: '许小星',
					mobile: '13853989563',
					addressName: '金九大道',
					address: '山东省济南市历城区',
					area: '149号',
					default: false,
				},
				typeID: 0, //
				goodsData: [], //购物车商品列表
				total: 0, //总计
				amount: 0, //商品金额
				Coupon: [], //优惠劵
				CouponID: 0, //礼券ID
				discounts: 0, //优惠金额
				expMoney: 0, //运费
				MDiscount: 1, //会员优惠
				TypeID: '',
				goodsTag: '01', //订单优惠标识
				orderid: '', //订单号
				repeat: 0, //重新提交订单 0新订单 1旧订单
				delivery: [], //送货自提
				radioVal: '0', //
				chooseCoupons:'', //选择优惠券
			}
		},
		onLoad(option) {
			uni.showLoading({
				title: '加载中'
			})
			this.$corpid = uni.getStorageSync('corpid')
			let Members = uni.getStorageSync('Members');
			this.TypeID = Members[0].FTypeID;
			this.Memberid = Members[0].MemberId;
			Discount = Members[0].FDiscount;
			//商品数据
			if (option.id != '2') {
				let id = option.id;
				let data = JSON.parse(option.data);
				let arr = [];
				//判断是否是数组
				if (data.goodsData instanceof Array == false) {
					arr.push(data.goodsData);
					this.goodsData = arr;
				} else {
					this.goodsData = data.goodsData;
				}
				this.typeID = id;
				this.orderData();
			} else {
				this.typeID = option.number; //1:单个商品 0:多个商品
				this.orderid = option.orderid;
				this.repeat = 1;
				this.onOrder();
			}
			console.log(this.goodsData, option);
		},
		onShow() {

		},
		onUnload() {
			// uni.removeStorageSync('extraData');
			Newid = '';
		},
		methods: {
			...mapMutations(['onCoupon', 'onCard']),
			//显示优惠券面板
			toggleMask(type) {
				if (this.repeat == 1 || this.orderid != '' || Newid != '') {
					this.$api.msg('当前订单优惠劵不可用');
					return;
				}
				console.log(this.Coupon);
				let timer = type === 'show' ? 10 : 300;
				let state = type === 'show' ? 1 : 0;
				this.maskState = 2;
				setTimeout(() => {
					this.maskState = state;
				}, timer)
			},
			numberChange(data) {
				this.number = data.number;
			},
			//提交
			submit() {
				if (this.payType == '') {
					uni.showModal({
						title: '支付提示',
						content: '请选择支付方式',
					})
					return;
				}
				if (this.deliveryTpye == '') {
					uni.showModal({
						title: '送货提示',
						content: '请选择送货方式',
					})
					return;
				}
				uni.showLoading({
					title: '加载中'
				})
				let address = this.addressData,
					coupon = this.Coupon,
					pay = Pay,
					GoodsData = {};
				if (this.typeID == 1 && this.orderid == '') {
					GoodsData = {
						img: this.goodsData[0].FProImage[0],
						title: this.goodsData[0].FName,
						price: this.TypeID == 1 ? (this.goodsData[0].FVipPrice) : (this.goodsData[0].FMallPrice),
						orgprice: null,
						mallprice: this.goodsData[0].FMallPrice,
						vipprice: this.goodsData[0].FVipPrice,
						id: this.goodsData[0].FItemID,
						qty: "1",
						total: this.total,
						FMallPoint: this.goodsData[0].FMallPoint,
					}
				}
				let data = {
					corpid: this.$corpid, //公司id
					FPrvID: address.FPrvID, //省ID
					FCityID: address.FCityID, //市ID
					FAreaID: address.FAreaID, //区ID
					FShippingID: address.FItemID, //运输方式
					PayType: this.payType, //付款方式ID
					DeliveryType: this.deliveryType,//送货方式
					FConsignee: address.FConsignee, //收件人
					FAddress: address.FPrCityArea + address.FAddress, //送货地址
					FTelephone: address.FPhone, //电话号码
					FMessage: this.desc, //订单留言
					type: this.typeID, //订单类型0:一般订单,1:立刻购买
					FCouponID: this.CouponID, //礼券ID
					FCouponMoney: this.discounts, //礼券金额
					FShippingAmt: this.expMoney, //运费
					FImportsFlag: 0, //是否进口商品
					FBillFlag: 0, //是否发票

					//新添加的内容(2020-10-27 / 28)
					FMemberID: this.Memberid, //会员id
					MemberType: this.TypeID, //会员等级
					// FRepeat =1重新提交订单     重新提交时 KInterID=订单ID
					FRepeat: this.repeat,
					KInterID: this.orderid,
					//TotalAmount 应付    RealAmount 实付  Detail 详细   MemberType
					TotalAmount: this.TotalAmount, //应付 
					RealAmount: this.total, //实付
					Detail: JSON.stringify(this.typeID == 1 ? (GoodsData) : (this.goodsData)), //详细
				};
				if (this.typeID == 1) {
					data.FSckillDetailID = this.goodsData[0].FItemID; //商品id
				}
				if (this.repeat == 0 && Newid == '') {
					this.$util.util('order/OrderSubmit', data, 'POST').then(res => {
						Newid = res.KInterID;
						let data = {
							orderid: res.KInterID,
							memberid: this.Memberid,
							PayType: this.payType,
						}
						this.onShopPay(data);
					}).catch(error => console.log(error));
				} else {
					let id = this.repeat == 0 ? Newid : this.orderid;
					let data = {
						orderid: id,
						memberid: this.Memberid,
						PayType: this.payType,
					}
					this.onShopPay(data);
				}
			},
			//支付
			onShopPay(data) {
				uni.showLoading({
					title: '支付中，请稍后'
				})
				//支付方式
				let PayID = this.payType;
				this.$util.util('sale/XcxShopPay', data, 'POST').then(res => {
					// console.log(res, res.data.respData);
					if (PayID === '2') { //会员卡支付
						Newid = '';
						if (this.CouponID != 0) {
							if (this.$store.state.couponNumber == 0) {
								this.onCoupon(0);
							} else {
								this.onCoupon(this.$store.state.couponNumber -= 1);
							}
						}
						setTimeout(() => {
							uni.hideLoading();
							this.$api.msg('会员卡支付成功');
							setTimeout(() => {
								uni.navigateTo({
									url: '/pages/order/paySuccess',
								})
							}, 600);
						}, 2000)
					} else { //微信支付
						let data = res.data.respData;
						uni.requestPayment({
							timeStamp: data.payTimeStamp,
							nonceStr: data.paynonceStr,
							package: data.payPackage,
							signType: data.paySignType,
							paySign: data.paySign,
							success: res => {
								Newid = '';
								if (this.CouponID != 0) {
									if (this.$store.state.couponNumber == 0) {
										this.onCoupon(0);
									} else {
										this.onCoupon(this.$store.state.couponNumber -= 1);
									}
								}
								this.$api.msg('成功');
								setTimeout(() => {
									uni.navigateTo({
										url: '/pages/order/paySuccess',
									})
								}, 600)
							},
							fail: (error) => {
								console.log(error);
								if (error.errMsg == "requestPayment:fail cancel") {
									this.$api.msg('用户已取消支付');
								} else {
									this.$api.msg('支付失败');
								}
							},
							complete: (data) => {
								console.log(data);
								uni.hideLoading();
							}
						})
					}
				}).catch(error => {
					console.log(error)
					uni.hideLoading();
				});
			},
			//使用优惠劵
			stopPrevent(item) {
				this.CouponID = item.SendId; //礼券ID
				if (this.amount >= item.FMinValue) {
					if (item.id === 0) {
						this.maskState = 1;
						this.$api.msg('该优惠劵为指定商品优惠劵');
					} else {
						this.discounts = item.FValue; //礼券金额
						this.maskState = 0;
						this.total = this.AmountData(this.TypeID, this.amount, 1, Discount);
						this.chooseCoupons = item.FName
					}
					// this.goodsTag = '00';//订单优惠标识
				} else {
					this.$api.msg('该订单未达到使用该优惠劵的金额');
				}
			},
			//商品信息
			orderData() {
				this.$util.util('order/CartOrderData', {
					corpid: this.$corpid
				}, 'POST').then(res => {
					
					this.Coupon = res.Coupon;
					Pay = res.Pay[0];
					// this.goodsData = res.Goods;
					let list = res.Address;
					if (list.length === 0) {
						this.addressData = ''
					}
					list.forEach(item => {
						if (item.FDefault == 1) {
							this.addressData = item;
							return;
						} else {
							this.addressData = list[0];
						}
					})
					this.onCoupons();
				})
			},
			onOrder() {
				this.$util.util('order/GetOrderList', {
					BillID: this.orderid,
					corpid: this.$corpid,
				}, 'POST').then(res => {
					uni.hideLoading();
					console.log(res);
					this.goodsData = res[0].data;
					let addressData = {
						FPrCityArea: '',
						FAddress: res[0].FAddress,
						FPhone: res[0].FTelephone,
						FConsignee: res[0].FConsignee,
						FPrvID: res[0].FPrvID,
						FCityID: res[0].FCityID,
						FAreaID: res[0].FAreaID,
					}
					this.addressData = addressData;
					this.onCoupons();

				}).catch(error => console.log(error));
			},
			//计算优惠
			onCoupons() {
				let qty = '';
				if (this.typeID == 1) {
					qty = 1;
				} else {
					this.goodsData.forEach(item => {
						qty += parseInt(item.qty)
					})
				}
				let moneyData = {
					corpid: this.$corpid, //公司id
					Pid: this.addressData.FPrvID, //省ID
					Cid: this.addressData.FCityID, //市ID
					ArID: this.addressData.FAreaID, //区ID
					FQty: qty, //数量
					FCmpID: 0, //快递公司ID
					Weight: '', //重量
					ImportFlag: '', //是否跨境商品
					Bulk: '', //体积
				}
				this.$util.util('order/Accexpmoney', moneyData, 'POST').then(res => {
					this.expMoney = res.ExpMoney; //运费
					uni.setStorageSync('ExpMoney', res.ExpMoney)
					console.log(this.goodsData);
					let number = 0; //当前订单的数量金额
					let Prices = 0; //看是否是旧的订单，如果是就拿订单中记录的price值来计算
					if (this.typeID == 1) { //单个商品
						// if (this.TypeID == 1) {
						// 	number = this.goodsData[0].FVipPrice == undefined ? this.goodsData[0].vipprice : this
						// 		.goodsData[0].FVipPrice;
						// } else {
						// 	number = this.goodsData[0].FMallPrice == undefined ? this.goodsData[0].mallprice : this
						// 		.goodsData[0].FMallPrice;
						// }
						number=this.goodsData[0].FMallPrice;
						console.log(number);
						if (number == null || this.orderid != '') {
							number = this.goodsData[0].price
						}
						this.amount = number;
						let qty = this.orderid != '' ? this.goodsData[0].qty : 1;
						this.total = this.AmountData(this.TypeID, this.amount, qty, Discount);
						this.TotalAmount = (this.amount * 1) + this.expMoney;
					} else { //多个商品
						for (var i in this.goodsData) {
							// if (this.TypeID == 1) {
							// 	Prices = this.orderid == '' ? this.goodsData[i].vipprice : this.goodsData[i].price;
							// 	number += Prices * this.goodsData[i].qty;
							// } else if (this.TypeID == 0 || this.TypeID == 2) {
							// 	Prices = this.orderid == '' ? this.goodsData[i].mallprice : this.goodsData[i].price;
							// 	number += Prices * this.goodsData[i].qty;
							// }
							Prices = this.orderid == '' ? this.goodsData[i].mallprice : this.goodsData[i].price;
							number += Prices * this.goodsData[i].qty;
						}
						this.amount = number.toFixed(2);
						this.total = this.AmountData(this.TypeID, number, 1, Discount);
						this.TotalAmount = (this.amount * 1) + this.expMoney;
					}
					this.MemberUser();
				})
				let Member = uni.getStorageSync('Members');
				this.MDiscount = Member[0].FDiscount;
			},
			//获取用户会员卡的优惠劵
			MemberUser() {
				let number = 0;
				let arr = [];
				let data = '';
				this.goodsData.forEach((item, index) => {
					if (this.goodsData.length == 1 && this.typeID == 1) {
						data = item.FItemID
						return;
					}
					if (this.goodsData.length == (index + 1)) {
						data += item.FItemID || item.id
					} else {
						data += item.FItemID || item.id + ','
					}
				})
				this.$util.util('MemberShop/CouponList', {
					'goodid': data
				}, 'POST').then(res => {
					console.log(res);
					res.forEach(item => {
						let timestamp = Date.parse(new Date()); //
						if (item.FStatus == 0) {
							let tiem = parseInt(item.FEndTime.slice(6, item.FEndTime.length -
							2)); //&&timestamp<tiem
							if (timestamp < tiem) {
								tiem = this.formatDate(tiem);
								item.endtiem = tiem;
								arr.push(item);
							}
						}
					})
					
					this.couponList = arr;
					this.Coupon = arr;
					this.GetDelivery();
				})
			},
			//送货自提
			GetDelivery() {
				let param = {
					corpId: this.$corpid, //公司id
				}
				this.$util.util('MemberShop/GetDeliveryInfo', param, 'POST').then(res => {
					this.delivery=res;
				})
				uni.hideLoading();
			},
			formatDate(value) {
				let date = new Date(value);
				let y = date.getFullYear();
				let MM = date.getMonth() + 1;
				MM = MM < 10 ? ('0' + MM) : MM;
				let d = date.getDate();
				d = d < 10 ? ('0' + d) : d;
				let h = date.getHours();
				h = h < 10 ? ('0' + h) : h;
				let m = date.getMinutes();
				m = m < 10 ? ('0' + m) : m;
				let s = date.getSeconds();
				s = s < 10 ? ('0' + s) : s;
				return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
			},
			/**
			 * { "id": "3", "text": "批发价" }
			 * 商品计算价格有三种模式：Members[0].FTypeID=>id this.discounts=>优惠劵 this.expMoney=>运费
			 * {"id": "1", "text": "会员价" },1、会员卡价 ->FVipPrice (FVipPrice*qty)+运费-优惠劵
			 * { "id": "2", "text": "零售价" },2、电商价 ->FMallPrice (FMallPrice*qty)+运费-优惠劵
			 * { "id": "0", "text": "折扣卡" },3、折扣卡	 ->FMallPrice (FMallPrice*Members[0].FDiscount)*qty+运费-优惠劵
			 */
			AmountData(id, price, qty, Discount) {
				let total;
				switch (id) {
					case 0:
						total = (price * Discount * qty) + this.expMoney - this.discounts;
						break;
					case 1:
						total = (price * qty) + this.expMoney - this.discounts;
						break;
					case 2:
						total = (price * qty) + this.expMoney - this.discounts;
						break;
					case 3:
						total = 3;
						break;
				}
				if (total < 0) {
					total = 0
				}
				return total.toFixed(2);
			},
			//选择送达方式
			radioChange(e) {
				console.log(e);
				let id = e.detail.value;
				this.radioVal = id;
				if (id === '1') {
					this.expMoney = 0;
				} else {
					this.expMoney = uni.getStorageSync('ExpMoney');
				}
				this.total = this.AmountData(this.TypeID, this.amount, 1, Discount);
			},
			//选择支付方式
			payChoose(e) {
				console.log(e);
				this.payType = e.detail.value;
			},
			deliveryChoosc(e){
				this.deliveryType = e.detail.value;
			}
		},
	}
</script>

<style lang="scss">
	page {
		background: $page-color-base;
		padding-bottom: 100upx;
	}

	.address-section {
		padding: 30upx 0;
		background: #fff;
		position: relative;

		.order-content {
			display: flex;
			align-items: center;
		}

		.icon-shouhuodizhi {
			flex-shrink: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 90upx;
			color: #888;
			font-size: 44upx;
		}

		.cen {
			display: flex;
			flex-direction: column;
			flex: 1;
			font-size: 28upx;
			color: $font-color-dark;
		}

		.name {
			font-size: 34upx;
			margin-right: 24upx;
		}

		.address {
			margin-top: 16upx;
			margin-right: 20upx;
			color: $font-color-light;
		}

		.icon-you {
			font-size: 32upx;
			color: $font-color-light;
			margin-right: 30upx;
		}

		.a-bg {
			position: absolute;
			left: 0;
			bottom: 0;
			display: block;
			width: 100%;
			height: 5upx;
		}
	}

	.goods-section {
		margin-top: 16upx;
		background: #fff;
		padding-bottom: 1px;

		.g-header {
			display: flex;
			align-items: center;
			height: 84upx;
			padding: 0 30upx;
			position: relative;
		}

		.logo {
			display: block;
			width: 50upx;
			height: 50upx;
			border-radius: 100px;
		}

		.name {
			font-size: 30upx;
			color: $font-color-base;
			margin-left: 24upx;
		}

		.g-item {
			display: flex;
			margin: 20upx 30upx;

			image {
				flex-shrink: 0;
				display: block;
				width: 140upx;
				height: 140upx;
				border-radius: 4upx;
			}

			.right {
				flex: 1;
				padding-left: 24upx;
				overflow: hidden;
			}

			.title {
				font-size: 30upx;
				color: $font-color-dark;
			}

			.spec {
				font-size: 26upx;
				color: $font-color-light;
			}

			.price-box {
				display: flex;
				align-items: center;
				font-size: 32upx;
				color: $font-color-dark;
				padding-top: 10upx;

				.price {
					margin-bottom: 4upx;
				}

				.number {
					font-size: 26upx;
					color: $font-color-base;
					margin-left: 20upx;
				}
			}

			.step-box {
				position: relative;
			}
		}
	}

	.yt-list {
		margin-top: 16upx;
		background: #fff;
	}

	.yt-list-cell {
		display: flex;
		align-items: center;
		padding: 10upx 30upx 10upx 40upx;
		line-height: 70upx;
		position: relative;

		&.cell-hover {
			background: #fafafa;
		}

		&.b-b:after {
			left: 30upx;
		}

		.cell-icon {
			height: 32upx;
			width: 32upx;
			font-size: 22upx;
			color: #fff;
			text-align: center;
			line-height: 32upx;
			background: #f85e52;
			border-radius: 4upx;
			margin-right: 12upx;

			&.hb {
				background: #ffaa0e;
			}

			&.lpk {
				background: #3ab54a;
			}

		}

		.cell-more {
			align-self: center;
			font-size: 24upx;
			color: $font-color-light;
			margin-left: 8upx;
			margin-right: -10upx;
		}

		.cell-tit {
			flex: 1;
			font-size: 26upx;
			color: $font-color-light;
			margin-right: 10upx;
		}

		.cell-tip {
			font-size: 26upx;
			color: $font-color-dark;

			&.disabled {
				color: $font-color-light;
			}

			&.active {
				color: $base-color;
			}

			&.red {
				color: $base-color;
			}
		}

		&.desc-cell {
			.cell-tit {
				max-width: 90upx;
			}
		}

		.desc {
			flex: 1;
			font-size: $font-base;
			color: $font-color-dark;
		}
	}

	/* 支付列表 */
	.pay-list {
		padding-left: 40upx;
		margin-top: 16upx;
		background: #fff;

		.pay-item {
			display: flex;
			align-items: center;
			padding-right: 20upx;
			line-height: 1;
			height: 110upx;
			position: relative;
		}

		.icon-weixinzhifu {
			width: 80upx;
			font-size: 40upx;
			color: #6BCC03;
		}

		.icon-alipay {
			width: 80upx;
			font-size: 40upx;
			color: #06B4FD;
		}

		.icon-xuanzhong2 {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 60upx;
			height: 60upx;
			font-size: 40upx;
			color: $base-color;
		}

		.tit {
			font-size: 32upx;
			color: $font-color-dark;
			flex: 1;
		}
	}

	.footer {
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 995;
		display: flex;
		align-items: center;
		width: 100%;
		height: 90upx;
		justify-content: space-between;
		font-size: 30upx;
		background-color: #fff;
		z-index: 998;
		color: $font-color-base;
		box-shadow: 0 -1px 5px rgba(0, 0, 0, .1);

		.price-content {
			padding-left: 30upx;
		}

		.price-tip {
			color: $base-color;
			margin-left: 8upx;
		}

		.price {
			font-size: 36upx;
			color: $base-color;
		}

		.submit {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 280upx;
			height: 100%;
			color: #fff;
			font-size: 32upx;
			background-color: $base-color;
		}
	}

	/* 优惠券面板 */
	.mask {
		display: flex;
		align-items: flex-end;
		position: fixed;
		left: 0;
		top: var(--window-top);
		bottom: 0;
		width: 100%;
		background: rgba(0, 0, 0, 0);
		z-index: 9995;
		transition: .3s;

		.mask-content {
			width: 100%;
			min-height: 30vh;
			max-height: 70vh;
			background: #f3f3f3;
			transform: translateY(100%);
			transition: .3s;
			overflow-y: scroll;
		}

		&.none {
			display: none;
		}

		&.show {
			background: rgba(0, 0, 0, .4);

			.mask-content {
				transform: translateY(0);
			}
		}
	}

	/* 优惠券列表 */
	.coupon-item {
		display: flex;
		flex-direction: column;
		margin: 20upx 24upx;
		background: #fff;

		.con {
			display: flex;
			align-items: center;
			position: relative;
			height: 120upx;
			padding: 0 30upx;

			&:after {
				position: absolute;
				left: 0;
				bottom: 0;
				content: '';
				width: 100%;
				height: 0;
				border-bottom: 1px dashed #f3f3f3;
				transform: scaleY(50%);
			}
		}

		.left {
			display: flex;
			flex-direction: column;
			justify-content: center;
			flex: 1;
			overflow: hidden;
			height: 100upx;
		}

		.title {
			font-size: 32upx;
			color: $font-color-dark;
			margin-bottom: 10upx;
		}

		.time {
			font-size: 24upx;
			color: $font-color-light;
		}

		.right {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			font-size: 26upx;
			color: $font-color-base;
			height: 100upx;
		}

		.price {
			font-size: 44upx;
			color: $base-color;

			&:before {
				content: '￥';
				font-size: 34upx;
			}
		}

		.tips {
			font-size: 24upx;
			color: $font-color-light;
			line-height: 60upx;
			padding-left: 30upx;
		}

		.circle {
			position: absolute;
			left: -6upx;
			bottom: -10upx;
			z-index: 10;
			width: 20upx;
			height: 20upx;
			background: #f3f3f3;
			border-radius: 100px;

			&.r {
				left: auto;
				right: -6upx;
			}
		}
	}
</style>
